#include <stdio.h>
#include <stdlib.h>
typedef struct BSTNode
{
	int data;
	struct BSTNode* left;
	struct BSTNode* right;
}BSTNode;
BSTNode* NewBSTNode(int data)
{
	BSTNode* NewNode = (BSTNode*)malloc(sizeof(BSTNode*));
	NewNode->data=data;
	NewNode->left=NewNode->right=NULL;
	return NewNode;
}
BSTNode* Input(BSTNode* root,int data)
{
	if(root==NULL)
		root=NewBSTNode(data);
	else if(data <= root->data)
		root->left=Input(root->left,data);
	else
		root->right=Input(root->right,data);
	return root;
}
int Search(BSTNode* root,int data)
{
	if(root==NULL)
		return 0;
	else if(root->data==data)
		return 1;
	else if(data <= root->data)
		return Search(root->left,data);
	else
		return Search(root->right,data);
}
void Preorder(BSTNode* root)//前序遍历
{
	if(root==NULL)
	return;
	printf("%d ",root->data);
	Preorder(root->left);
	Preorder(root->right);
}
void Inorder(BSTNode* root)//中序遍历
{
	if(root==NULL)
	return;
	Inorder(root->left);
	printf("%d ",root->data);
	Inorder(root->right);
}
void Postorder(BSTNode* root)//后序遍历
{
	if(root==NULL)
	return;
	Postorder(root->left);
	Postorder(root->right);
	printf("%d ",root->data);
}
int main(void)
{
	
}
